
package com.jf.cloud.product.service.impl;

import com.jf.cloud.common.database.dto.PageDTO;
import com.jf.cloud.common.database.util.PageUtil;
import com.jf.cloud.common.database.vo.PageVO;
import com.jf.cloud.product.dto.StockChangeReasonDTO;
import com.jf.cloud.product.mapper.StockChangeReasonLangMapper;
import com.jf.cloud.product.model.StockChangeReasonLang;
import com.jf.cloud.product.service.StockChangeReasonLangService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 出入库原因-国际化
 *
 * @author zz
 * @date 2022-06-22 16:57:27
 */
@Service
public class StockChangeReasonLangServiceImpl implements StockChangeReasonLangService {

    @Autowired
    private StockChangeReasonLangMapper stockChangeReasonLangMapper;

    @Override
    public PageVO<StockChangeReasonLang> page(PageDTO pageDTO) {
        return PageUtil.doPage(pageDTO, () -> stockChangeReasonLangMapper.list());
    }

    @Override
    public StockChangeReasonLang getByStockChangeReasonId(Long stockChangeReasonId) {
        return stockChangeReasonLangMapper.getByStockChangeReasonId(stockChangeReasonId);
    }

    @Override
    public void save(StockChangeReasonLang stockChangeReasonLang) {
        stockChangeReasonLangMapper.save(stockChangeReasonLang);
    }

    @Override
    public void update(StockChangeReasonLang stockChangeReasonLang) {
        stockChangeReasonLangMapper.update(stockChangeReasonLang);
    }

    @Override
    public void deleteById(Long stockChangeReasonId) {
        stockChangeReasonLangMapper.deleteById(stockChangeReasonId);
    }

    @Override
    public Integer countReason(StockChangeReasonDTO stockChangeReasonDTO) {
        return stockChangeReasonLangMapper.countReason(stockChangeReasonDTO);
    }
}
